package com.stylefeng.guns.common.persistence.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author stylefeng123
 * @since 2018-02-05
 */
@TableName("lg_chapter")
public class Chapter extends Model<Chapter> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Integer bookid;
    /**
     * 名称
     */
    @Length(min = 1, max = 100, message = "文章名称字数必须在1到100之间")
    @NotBlank(message="文章名称不能为空")
    private String name;
    private Integer sort;
    /**
     * 阅读次数
     */
    private Integer readnumber;
    /**
     * 内容
     */
    private String content;
    /**
     * 备注
     */
    @Length(max = 1000, message = "备注字数不能大于1000")
    private String remarks;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBookid() {
        return bookid;
    }

    public void setBookid(Integer bookid) {
        this.bookid = bookid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getReadnumber() {
        return readnumber;
    }

    public void setReadnumber(Integer readnumber) {
        this.readnumber = readnumber;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Chapter{" +
        "id=" + id +
        ", bookid=" + bookid +
        ", name=" + name +
        ", sort=" + sort +
        ", readnumber=" + readnumber +
        ", content=" + content +
        ", remarks=" + remarks +
        "}";
    }
}
